using FluentValidation;
using Gateway.IApplication.Tenant.Input;
using Gateway.IApplication.Validation;

namespace Gateway.IApplication.Tenant.Validation;
/// <summary>
/// 基础的租户验证
/// </summary>
/// <typeparam name="T"></typeparam>
public class BaseTenantValidation<T> : AbstractValidator<T>,IFluentValidation where T : CreateTenantInput
{
    /// <summary>
    /// 
    /// </summary>
    public BaseTenantValidation()
    {
        RuleFor(x => x.TenantName).NotEmpty().WithMessage("名称不能为空");
        RuleFor(x => x.TenantAliasName).NotEmpty();
        RuleFor(x => x.ContactName).NotEmpty();
        RuleFor(x => x.ContactPhone).NotEmpty();
        RuleFor(x => x.ExpireTime).NotEmpty();
        RuleFor(x => x.TenantDomain).NotEmpty();
    }
}